// function mock (app, url, data) {
//     app.get(url, (req, res) => {
//         res.json(data)
//     })
// }

// const homeData = require('./src/mock/bookHome')
// const shelfData = require('./src/mock/bookShelf')
// const listData = require('./src/mock/bookList')
// const flatListData = require('./src/mock/bookFlatList')

module.exports = {
  baseUrl: process.env.NODE_ENV === 'production'
    ? './'
    : '/',
  devServer: {
    // before (app) {
    //     mock(app, '/book/home', homeData)
    //     mock(app, '/book/shelf', shelfData)
    //     mock(app, '/book/list', listData)
    //     mock(app, '/book/flat-list', flatListData)
    // }
    proxy: {
      '/api': {
        target: 'https://ebook.ourclubs.cn'
      },
      '/res': {
        target: 'https://ebook.ourclubs.cn'
      }
    }
  },
  configureWebpack: {
    performance: {
      hints: 'warning',
      maxAssetSize: 524288, // 512K
      maxEntrypointSize: 524288 // 512K
    }
  }
}
